import request from '@/utils/request'

// 查询成本分配产品列表
export function listLine(query) {
  return request({
    url: '/financial/line/list',
    method: 'get',
    params: query
  })
}
export function listDetail(query) {
  return request({
    url: '/financial/line/detailList',
    method: 'get',
    params: query
  })
}

// 查询成本分配产品详细
export function getLine(lineId) {
  return request({
    url: '/financial/line/' + lineId,
    method: 'get'
  })
}

// 新增成本分配产品
export function addLine(data) {
  return request({
    url: '/financial/line',
    method: 'post',
    data: data
  })
}

// 修改成本分配产品
export function updateLine(data) {
  return request({
    url: '/financial/line',
    method: 'put',
    data: data
  })
}

// 删除成本分配产品
export function delLine(lineId) {
  return request({
    url: '/financial/line/' + lineId,
    method: 'delete'
  })
}
// 根据BOMID查询树形结构
export function listTree(workorderCode) {
  return request({
    url: '/financial/line/tree',
    method: 'get',
    params: {
      workorderCode: workorderCode
    }
  })
}


